export default function (blob, fileName) {
  if (!blob || !fileName) {
    console.error('尝试 下载 空数据！');
    return;
  }
  if (window.navigator.msSaveOrOpenBlob) {
    navigator.msSaveBlob(blob, fileName);
  } else {
    let link = document.createElement('a');
    if (blob.constructor === Blob) {
      link.href = window.URL.createObjectURL(blob);
    } else {
      link.href = blob;
    }
    link.download = fileName;
    link.click();
    window.URL.revokeObjectURL(link.href);
  }
};
